//
// Created by lingzhitech on 25-11-7.
//
#include <iostream>
using namespace std;

class Base {
public:
    virtual void sayHi() const { cout << "Hello from Base\n"; }
};

class Derived : public Base {
public:
    void sayHi() const override {
        cout << "Hello from Derived\n";

        // 🔹 在成员函数内部直接调用基类版本
        // sayHi(); // 无线递归
        Base::sayHi();  // 绕过虚函数机制，直接调用 Base::sayHi
    }
};

int main() {
    Derived d;
    d.sayHi();
}
